package com.lanca.controller;

import com.lanca.feignclient.ProductClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CategoryController {

    private static final Logger log = LoggerFactory.getLogger(CategoryController.class);

    @Value("${server.port}")
    private int port;

    @Autowired
    private ProductClient productClient;

    @GetMapping("/category")
    public String category() {
//        String product = productClient.getProduct();
//        String result = productClient.test("小丑", 234);
//        log.info("category,,,......");
//        log.info(result);
//        return "category   aaa ok!  -->端口" + port +" = "+ product;
        String nameValue = productClient.test1(12, "nameValue");
        log.info("category端口：" + port + " " + nameValue);
        return "category端口：" + port + " " + nameValue;
    }
}
